public class TestDemo {
    public static void main(String[] args) {
        MArrayList<Integer> list = new MArrayList<>();
        list.add(0,1);
        list.add(1,2);
        list.add(2,3);
        list.add(3,4);
        list.add(4,2);
        System.out.println(list.contains(3));
        System.out.println(list.search(3));
        System.out.println(list.getPos(3));
        list.remove(2);
        list.display();
        System.out.println(list.size());
        list.clear();
        list.display();
    }

    public static void main1(String[] args) {
        //顺序表的对象
        MyArrayList myArrayList = new MyArrayList();
        myArrayList.add(0,1);
        myArrayList.add(1,2);
        myArrayList.add(2,3);
        myArrayList.add(3,4);
        myArrayList.add(4,5);
        myArrayList.add(5,6);
        myArrayList.add(6,7);
        myArrayList.add(7,8);
        myArrayList.display();
        myArrayList.remove(11);
        myArrayList.remove(5);
        myArrayList.display();
    }
}
